home *** CD-ROM | disk | FTP | other *** search
/ Software of the Month Club 2000 October / Software of the Month - Ultimate Collection Shareware 277.iso / pc / PROGRAMS / UTILITY / WINLINUX / DATA1.CAB / programs_-_libmpeg / INCLUDE / MPEG.H < prev   
C/C++ Source or Header  |  1999-09-17  |  3KB  |  108 lines

  1. /* ----------------------------- MNI Header -----------------------------------
  2. @NAME       : mpeg.h
  3. @INPUT      : 
  4. @OUTPUT     : 
  5. @RETURNS    : 
  6. @DESCRIPTION: Types and function prototypes needed for applications to
  7.               use the Berkely MPEG decoding engine via the MNI front
  8.               end.
  9. @METHOD     : 
  10. @GLOBALS    : Types defined:
  11.                  ImageDesc  - structure giving height, width, etc.
  12.                  DitherEnum - the different dither types supported by
  13.                               the decoding engine
  14. @CALLS      : 
  15. @CREATED    : Greg Ward, 94/6/16.
  16. @MODIFIED   : Greg Ward, 94/9/12 (based on John Cristy's fixes): made
  17.               more amenable to use with other libraries that also
  18.           happen to define TRUE, FALSE, [Bb]oolean, and added
  19.           PROTO macro
  20. ---------------------------------------------------------------------------- */
  21.  
  22. #ifndef __MPEG_H
  23. #define __MPEG_H
  24.  
  25. #include <stdio.h>
  26.  
  27. /* An attempt at a portable and integrable boolean type... */
  28.  
  29. #if (!defined(TRUE) || !defined(FALSE))
  30. # define TRUE 1
  31. # define FALSE 0
  32. #endif
  33.  
  34. #if (!defined (BOOLEAN_TYPE_EXISTS))
  35. typedef unsigned int Boolean;
  36. #endif
  37.  
  38. typedef struct
  39. {
  40.    short red, green, blue;
  41. } ColormapEntry;
  42.  
  43. typedef struct
  44. {
  45.    int    Height;            /* in pixels */
  46.    int  Width;
  47.    int  Depth;            /* image depth (bits) */
  48.    int  PixelSize;              /* bits actually stored per pixel */
  49.    int  Size;            /* bytes for whole image */
  50.    int  BitmapPad;              /* "quantum" of a scanline -- each scanline */
  51.                 /* starts on an even interval of this */
  52.                                 /* many bits */
  53.    int  PictureRate;        /* required number of frames/sec [?] */
  54.    int  BitRate;        /* ??? */
  55.    
  56.    int  ColormapSize;
  57.    ColormapEntry *Colormap;    /* an array of ColormapSize entries */
  58. } ImageDesc;
  59.  
  60. typedef enum 
  61. {
  62.    HYBRID_DITHER,
  63.    HYBRID2_DITHER,
  64.    FS4_DITHER,
  65.    FS2_DITHER,
  66.    FS2FAST_DITHER,
  67.    Twox2_DITHER,
  68.    GRAY_DITHER,
  69.    FULL_COLOR_DITHER,
  70.    NO_DITHER,
  71.    ORDERED_DITHER,
  72.    MONO_DITHER,
  73.    MONO_THRESHOLD,
  74.    ORDERED2_DITHER,
  75.    MBORDERED_DITHER
  76. } DitherEnum;
  77.  
  78.  
  79. typedef enum
  80. {
  81.    MPEG_DITHER,
  82.    MPEG_QUIET,
  83.    MPEG_LUM_RANGE,
  84.    MPEG_CR_RANGE,
  85.    MPEG_CB_RANGE,
  86.    MPEG_CMAP_INDEX
  87. } MPEGOptionEnum;
  88.  
  89. /* Kludge so we can compile under ANSI or K&R */
  90.  
  91. #undef PROTO
  92. #if __STDC__
  93. #define PROTO(formal_parameters) formal_parameters
  94. #else
  95. #define const
  96. #define PROTO(formal_parameters) ()
  97. #endif
  98.  
  99. /* Function prototypes (all are defined in wrapper.c) */
  100.  
  101. Boolean OpenMPEG PROTO((FILE *MPEGfile, ImageDesc *ImgInfo));
  102. void    CloseMPEG PROTO((void));
  103. Boolean RewindMPEG PROTO((FILE *MPEGfile, ImageDesc *Image));
  104. void    SetMPEGOption PROTO((MPEGOptionEnum Option, int value));
  105. Boolean GetMPEGFrame PROTO((char *Frame));
  106.  
  107. #endif   /* __MPEG_H */
  108.